home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / misc / per.sed.first < prev    next >
Encoding:
Text File  |  1994-02-02  |  1.1 KB  |  38 lines  |  [TEXT/R*ch]

  1. # Comment out all lines.
  2. s/^/;/
  3. s/^;[ ]*$//
  4. # Change brackets to parens.
  5. s/\[ /(/g
  6. s/ \]/)/g
  7. s/\[/(/g
  8. s/\]/)/g
  9. # Convert the first line to a game-module form.
  10. /Xconq/s/^;Xconq . [+-]* \(.*\)$/(game-module "???"\
  11.   (blurb "\1")\
  12.   )\
  13. /
  14. # Convert the period name to a game title.
  15. /period/s/;\(.*\) period-name/(game-module (title \1))/
  16. # Convert utype forms to unit-type forms.
  17. /utype/s/;"\(.\)" "\(.*\)" "\(.*\)" utype/(unit-type \1 (name "\2") (char "\1")\
  18.   (help "\3"))/
  19. # Convert resource type decls to material-type forms.
  20. /rtype/s/;"\(.\)" "\(.*\)" "\(.*\)" rtype/(material-type |\2| (help "\3"))/
  21. # Convert terrain types similarly.
  22. /ttype/s/;"\(.\)" "\(.*\)" "\(.*\)" ttype/(terrain-type |\2| (char "\1") (color "\3"))/
  23.  
  24. /icon-name/s/;\(.*\) \(.*\) icon-name[ ]*$/(add \2 image-name \1)/
  25. # Convert variable definitions.
  26. /define/s/;\(.*\) "\(.*\)" define/(define \2 \1)/
  27.  
  28. # Add empty game-module properties that usually go at the end.
  29. $a\
  30. (game-module (instructions (\
  31. \ \ )))\
  32. (game-module (notes (\
  33. \ \ )))\
  34. (game-module (design-notes (\
  35. \ \ )))
  36. # Remove the end-of-period marker.
  37. /^;[ ]*end[ ]*$/d
  38.